<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Os1: /home/alejandro/Desarrollo eclipse/os1/include/Optimizer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Os1
   &#160;<span id="projectnumber">1</span>
   </div>
   <div id="projectbrief">OrbSlam2 documentado y modificado</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,'Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_optimizer_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Optimizer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_optimizer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#ifndef OPTIMIZER_H</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#define OPTIMIZER_H</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_map_8h.html">Map.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_map_point_8h.html">MapPoint.h</a>&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_key_frame_8h.html">KeyFrame.h</a>&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_loop_closing_8h.html">LoopClosing.h</a>&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_frame_8h.html">Frame.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;../Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_o_r_b___s_l_a_m2.html">ORB_SLAM2</a></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;{</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">class </span>LoopClosing;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html">   44</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html">Optimizer</a></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;{</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordtype">void</span> <span class="keyword">static</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#aac6bf926792ed8a013d64897879a89ec">BundleAdjustment</a>(<span class="keyword">const</span> std::vector&lt;KeyFrame*&gt; &amp;vpKF, <span class="keyword">const</span> std::vector&lt;MapPoint*&gt; &amp;vpMP,</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                                 <span class="keywordtype">int</span> nIterations = 5, <span class="keywordtype">bool</span> *pbStopFlag=NULL, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nLoopKF=0,</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                                 <span class="keyword">const</span> <span class="keywordtype">bool</span> bRobust = <span class="keyword">true</span>);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">void</span> <span class="keyword">static</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#aaa9b8a4c16296bf2981b0aaf4ee3189c">GlobalBundleAdjustemnt</a>(<a class="code" href="class_o_r_b___s_l_a_m2_1_1_map.html">Map</a>* pMap, <span class="keywordtype">int</span> nIterations=5, <span class="keywordtype">bool</span> *pbStopFlag=NULL,</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                                       <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nLoopKF=0, <span class="keyword">const</span> <span class="keywordtype">bool</span> bRobust = <span class="keyword">true</span>);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordtype">void</span> <span class="keyword">static</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#ab70e0b4f366b65a0c1ae8b2def19d339">LocalBundleAdjustment</a>(<a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a>* pKF, <span class="keywordtype">bool</span> *pbStopFlag, <a class="code" href="class_o_r_b___s_l_a_m2_1_1_map.html">Map</a> *pMap);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keywordtype">int</span> <span class="keyword">static</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a7415d78b8a2323b88e108fa1ea3bf2d3">PoseOptimization</a>(<a class="code" href="class_o_r_b___s_l_a_m2_1_1_frame.html">Frame</a>* pFrame);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="comment">// if bFixScale is true, 6DoF optimization (stereo,rgbd), 7DoF otherwise (mono)</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keywordtype">void</span> <span class="keyword">static</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a5a53ab409feed7f92547eb79a2d7f6e9">OptimizeEssentialGraph</a>(<a class="code" href="class_o_r_b___s_l_a_m2_1_1_map.html">Map</a>* pMap, <a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a>* pLoopKF, <a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a>* pCurKF,</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                                       <span class="keyword">const</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_loop_closing.html#ae9ada143a8308ce32990a7c7b5d533ab">LoopClosing::KeyFrameAndPose</a> &amp;NonCorrectedSim3,</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;                                       <span class="keyword">const</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_loop_closing.html#ae9ada143a8308ce32990a7c7b5d533ab">LoopClosing::KeyFrameAndPose</a> &amp;CorrectedSim3,</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;                                       <span class="keyword">const</span> map&lt;<a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a> *, set&lt;KeyFrame *&gt; &gt; &amp;LoopConnections,</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;                                       <span class="keyword">const</span> <span class="keywordtype">bool</span> &amp;bFixScale);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="comment">// if bFixScale is true, optimize SE3 (stereo,rgbd), Sim3 otherwise (mono)</span></div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a91fbb960965c99e9802a5de45515813c">OptimizeSim3</a>(<a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a>* pKF1, <a class="code" href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">KeyFrame</a>* pKF2, std::vector&lt;MapPoint *&gt; &amp;vpMatches1,</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;                            <a class="code" href="structg2o_1_1_sim3.html">g2o::Sim3</a> &amp;g2oS12, <span class="keyword">const</span> <span class="keywordtype">float</span> th2, <span class="keyword">const</span> <span class="keywordtype">bool</span> bFixScale);</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;};</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;} <span class="comment">//namespace ORB_SLAM</span></div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="preprocessor">#endif // OPTIMIZER_H</span></div><div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_frame_html"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_frame.html">ORB_SLAM2::Frame</a></div><div class="ttdoc">Frame representa un cuadro, una imagen, con los puntos singulares detectados. </div><div class="ttdef"><b>Definition:</b> Frame.h:59</div></div>
<div class="ttc" id="_map_point_8h_html"><div class="ttname"><a href="_map_point_8h.html">MapPoint.h</a></div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_a5a53ab409feed7f92547eb79a2d7f6e9"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a5a53ab409feed7f92547eb79a2d7f6e9">ORB_SLAM2::Optimizer::OptimizeEssentialGraph</a></div><div class="ttdeci">static void OptimizeEssentialGraph(Map *pMap, KeyFrame *pLoopKF, KeyFrame *pCurKF, const LoopClosing::KeyFrameAndPose &amp;NonCorrectedSim3, const LoopClosing::KeyFrameAndPose &amp;CorrectedSim3, const map&lt; KeyFrame *, set&lt; KeyFrame *&gt; &gt; &amp;LoopConnections, const bool &amp;bFixScale)</div><div class="ttdoc">Optimiza el grafo esencial para cerrar un bucle. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:781</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_a91fbb960965c99e9802a5de45515813c"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a91fbb960965c99e9802a5de45515813c">ORB_SLAM2::Optimizer::OptimizeSim3</a></div><div class="ttdeci">static int OptimizeSim3(KeyFrame *pKF1, KeyFrame *pKF2, std::vector&lt; MapPoint *&gt; &amp;vpMatches1, g2o::Sim3 &amp;g2oS12, const float th2, const bool bFixScale)</div><div class="ttdoc">Determina la transformación sim3 entre dos keyframes, que mejor explica un macheo. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:1050</div></div>
<div class="ttc" id="structg2o_1_1_sim3_html"><div class="ttname"><a href="structg2o_1_1_sim3.html">g2o::Sim3</a></div><div class="ttdef"><b>Definition:</b> sim3.h:41</div></div>
<div class="ttc" id="_map_8h_html"><div class="ttname"><a href="_map_8h.html">Map.h</a></div></div>
<div class="ttc" id="_key_frame_8h_html"><div class="ttname"><a href="_key_frame_8h.html">KeyFrame.h</a></div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_aaa9b8a4c16296bf2981b0aaf4ee3189c"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#aaa9b8a4c16296bf2981b0aaf4ee3189c">ORB_SLAM2::Optimizer::GlobalBundleAdjustemnt</a></div><div class="ttdeci">static void GlobalBundleAdjustemnt(Map *pMap, int nIterations=5, bool *pbStopFlag=NULL, const unsigned long nLoopKF=0, const bool bRobust=true)</div><div class="ttdoc">Ejecuta BundleAdjstment tomando los datos del mapa. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:41</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_map_html"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_map.html">ORB_SLAM2::Map</a></div><div class="ttdoc">Mapa del mundo, de puntos y keyframes. </div><div class="ttdef"><b>Definition:</b> Map.h:52</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_key_frame_html"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_key_frame.html">ORB_SLAM2::KeyFrame</a></div><div class="ttdoc">Cuadro clave, keyframe. </div><div class="ttdef"><b>Definition:</b> KeyFrame.h:79</div></div>
<div class="ttc" id="namespace_o_r_b___s_l_a_m2_html"><div class="ttname"><a href="namespace_o_r_b___s_l_a_m2.html">ORB_SLAM2</a></div><div class="ttdoc">This file is part of ORB-SLAM2. </div><div class="ttdef"><b>Definition:</b> Converter.h:31</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_loop_closing_html_ae9ada143a8308ce32990a7c7b5d533ab"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_loop_closing.html#ae9ada143a8308ce32990a7c7b5d533ab">ORB_SLAM2::LoopClosing::KeyFrameAndPose</a></div><div class="ttdeci">map&lt; KeyFrame *, g2o::Sim3, std::less&lt; KeyFrame * &gt;, Eigen::aligned_allocator&lt; std::pair&lt; const KeyFrame *, g2o::Sim3 &gt; &gt; &gt; KeyFrameAndPose</div><div class="ttdef"><b>Definition:</b> LoopClosing.h:66</div></div>
<div class="ttc" id="_loop_closing_8h_html"><div class="ttname"><a href="_loop_closing_8h.html">LoopClosing.h</a></div></div>
<div class="ttc" id="_frame_8h_html"><div class="ttname"><a href="_frame_8h.html">Frame.h</a></div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html">ORB_SLAM2::Optimizer</a></div><div class="ttdoc">Optimizer concentra todas las operaciones con g2o. </div><div class="ttdef"><b>Definition:</b> Optimizer.h:44</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_aac6bf926792ed8a013d64897879a89ec"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#aac6bf926792ed8a013d64897879a89ec">ORB_SLAM2::Optimizer::BundleAdjustment</a></div><div class="ttdeci">static void BundleAdjustment(const std::vector&lt; KeyFrame *&gt; &amp;vpKF, const std::vector&lt; MapPoint *&gt; &amp;vpMP, int nIterations=5, bool *pbStopFlag=NULL, const unsigned long nLoopKF=0, const bool bRobust=true)</div><div class="ttdoc">Bundle adjusment sobre los keyframes y puntos el mapa pasados como argumentos. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:49</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_ab70e0b4f366b65a0c1ae8b2def19d339"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#ab70e0b4f366b65a0c1ae8b2def19d339">ORB_SLAM2::Optimizer::LocalBundleAdjustment</a></div><div class="ttdeci">static void LocalBundleAdjustment(KeyFrame *pKF, bool *pbStopFlag, Map *pMap)</div><div class="ttdoc">Bundle adjusment local a partir de un keyframe. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:453</div></div>
<div class="ttc" id="class_o_r_b___s_l_a_m2_1_1_optimizer_html_a7415d78b8a2323b88e108fa1ea3bf2d3"><div class="ttname"><a href="class_o_r_b___s_l_a_m2_1_1_optimizer.html#a7415d78b8a2323b88e108fa1ea3bf2d3">ORB_SLAM2::Optimizer::PoseOptimization</a></div><div class="ttdeci">static int PoseOptimization(Frame *pFrame)</div><div class="ttdoc">Cómputo de la pose de un cuadro. </div><div class="ttdef"><b>Definition:</b> Optimizer.cc:239</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="_optimizer_8h.html">Optimizer.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
